package com.account.boot.model;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import com.account.boot.model.vo.UserVo;

public class User extends BaseModel{

    private String uid;

    private String name;

    private String nickName;

    private String password;

    private String email;

    private String head;
    
    private Timestamp createDate;

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid == null ? null : uid.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName == null ? null : nickName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getHead() {
        return head;
    }

    public void setHead(String head) {
        this.head = head == null ? null : head.trim();
    }
    
	public Timestamp getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	public UserVo userVo() 
    {
    		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    	
    		UserVo userVo = new UserVo();
    		userVo.setUid(uid);
    		userVo.setName(name);
    		userVo.setNickName(nickName);
    		userVo.setPassword(password);
    		userVo.setEmail(email);
    		userVo.setCreateDate(sdf.format(createDate));
    		
    		return userVo;
    }
}